% This script generates Figure 5 in the manuscript.
% The figure plots the import share of the manufacturing sector in the Rust
% Belt and import share of the manufacturing sector for the U.S. as a
% whole.
%% Load data and results from benchmark parameterization.
clearvars;
year = 1950:1:2000;
cd ..
cd ./quantitative_model
load('solution_model_BM.mat');
cd ..
cd ./replicate_figures
%% Figure 5: Import Shares in Model and Data
figure(5)
plot(year(9:45),import_shares_US_MFG_data(9:45),LineStyle=':',LineWidth = 2,Color='k');
text(1985,34,'All Mfg, data',FontSize=13,Color='k');
annotation("arrow",([1987 1985]-1949)./52,[37 33.5]./101,Color='k');
hold on
plot(year(9:45),import_shares_RB_wtd_avg_data(9:45),LineStyle='-',LineWidth = 2,Color='k');
text(1969,47,'Rust Belt, data',FontSize=13);
annotation("arrow",([1977 1978]-1949)./52,[47 42]./101);
hold on
plot(year,Agg_import_share.*100,LineStyle='--',LineWidth=2,Color='k');
text(1990,18.5,'All Mfg, model',FontSize=13,Color='k');
annotation("arrow",([1991.5 1993]-1949)./52,[30 38]./101,Color='k');
hold on
plot(year,RB_import_share.*100,LineStyle='-.',LineWidth=2,Color='k');
text(1989,47,'Rust Belt, model',FontSize=13);
annotation("arrow",([1986.5 1985]-1949)./52,[50 50]./101);
xlim([1949 2001]);
xticks(1950:10:2000);
ylim([-1 101]);
yticks(0:25:100);
set(gca,'box','off','TickDir','out','FontSize',14);
xline(2001,'k');
yline(101,'k');
ylabel('Import Share',FontSize=14);
grid on
hold off
%% Save Figure 5 in PDF and EPS file formats.
saveas(gcf,'fig5.pdf');
saveas(gcf,'fig5','epsc');